36 Zeilen
1.5 KiB
Diff
36 Zeilen
1.5 KiB
Diff
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 04cb8279f2296cc42405355c7c1f120e761202c4..1df815c2e430a308baea08c9a7f3ca43377dc16e 100644
|
|
--- a/src/main/java/org/bukkit/Material.java
|
|
+++ b/src/main/java/org/bukkit/Material.java
|
|
@@ -4771,6 +4771,23 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
|
}
|
|
// Paper end - item rarity API
|
|
|
|
+ // Paper start - item default attributes API
|
|
+ /**
|
|
+ * 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 - item default attributes API
|
|
+
|
|
/**
|
|
* Do not use for any reason.
|
|
*
|