#978: Add Material#getDefaultAttributeModifiers

By: coll1234567 <joshl5324@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2021-12-24 12:06:26 +11:00
parent 28ec7a3566
commit 23b34c080b
2 changed files with 28 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import java.util.List;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.attribute.AttributeModifier;
import org.bukkit.inventory.EquipmentSlot;
public class CraftAttributeInstance implements AttributeInstance {
@@ -72,4 +73,8 @@ public class CraftAttributeInstance implements AttributeInstance {
public static AttributeModifier convert(net.minecraft.world.entity.ai.attributes.AttributeModifier nms) {
return new AttributeModifier(nms.getId(), nms.getName(), nms.getAmount(), AttributeModifier.Operation.values()[nms.getOperation().ordinal()]);
}
public static AttributeModifier convert(net.minecraft.world.entity.ai.attributes.AttributeModifier nms, EquipmentSlot slot) {
return new AttributeModifier(nms.getId(), nms.getName(), nms.getAmount(), AttributeModifier.Operation.values()[nms.getOperation().ordinal()], slot);
}
}