aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0285-Attributes-API-for-item-defaults.patch
blob: db30aff62c1cec89d182f8dd7c70308846d9a63a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Sat, 8 May 2021 15:02:00 -0700
Subject: [PATCH] Attributes API for item defaults

(Now replaced by upstream's API)

diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 1e4ebe9bdc6aadf18029377e7ce70ca0d88bd1a1..3cb658023d738617a310099fa3759af253a9f4c2 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -4763,6 +4763,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
     public io.papermc.paper.inventory.ItemRarity getItemRarity() {
         return new org.bukkit.inventory.ItemStack(this).getRarity();
     }
+
+    /**
+     * Returns an immutable multimap of attributes for the slot.
+     * {@link #isItem()} must be true for this material.
+     *
+     * @param equipmentSlot the slot to get the attributes for
+     * @throws IllegalArgumentException if {@link #isItem()} is false
+     * @return an immutable multimap of attributes
+     * @deprecated use {@link #getDefaultAttributeModifiers(EquipmentSlot)}
+     */
+    @NotNull
+    @Deprecated(forRemoval = true, since = "1.20.5")
+    public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) {
+        return this.getDefaultAttributeModifiers(equipmentSlot);
+    }
     // Paper end
 
     /**