2021-06-11 14:02:28 +02:00
|
|
|
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
|
|
|
|
|
2024-04-26 08:10:38 +02:00
|
|
|
(Now replaced by upstream's API)
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
2024-05-11 23:48:37 +02:00
|
|
|
index 044c563daee7898c676bd6ba58ee395c52eda121..f6c3a4de2f07348d599e44d0b3173b8674ee85ac 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/Material.java
|
|
|
|
+++ b/src/main/java/org/bukkit/Material.java
|
2024-05-11 23:48:37 +02:00
|
|
|
@@ -4765,6 +4765,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
2021-06-11 14:02:28 +02:00
|
|
|
public io.papermc.paper.inventory.ItemRarity getItemRarity() {
|
2024-04-27 01:43:59 +02:00
|
|
|
return new org.bukkit.inventory.ItemStack(this).getRarity();
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 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
|
2022-01-01 04:05:42 +01:00
|
|
|
+ * @deprecated use {@link #getDefaultAttributeModifiers(EquipmentSlot)}
|
2021-06-11 14:02:28 +02:00
|
|
|
+ */
|
|
|
|
+ @NotNull
|
2024-04-26 08:10:38 +02:00
|
|
|
+ @Deprecated(forRemoval = true, since = "1.20.5")
|
2022-01-01 04:05:42 +01:00
|
|
|
+ public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) {
|
2024-04-26 08:10:38 +02:00
|
|
|
+ return this.getDefaultAttributeModifiers(equipmentSlot);
|
2021-06-11 14:02:28 +02:00
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
/**
|