mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 04:02:06 -07:00
fix issue with item default attribute API
This commit is contained in:
@@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) {
|
||||
return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot);
|
||||
return this.getDefaultAttributeModifiers(equipmentSlot);
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
|
@@ -3,6 +3,7 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
@@ -23,33 +24,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * @deprecated use {@link #getDefaultAttributeModifiers(EquipmentSlot)}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated
|
||||
+ @Deprecated(forRemoval = true, since = "1.20.5")
|
||||
+ public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) {
|
||||
+ return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot);
|
||||
+ return this.getDefaultAttributeModifiers(equipmentSlot);
|
||||
+ }
|
||||
// Paper end
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -0,0 +0,0 @@ public interface UnsafeValues {
|
||||
*/
|
||||
public boolean isValidRepairItemStack(@org.jetbrains.annotations.NotNull ItemStack itemToBeRepaired, @org.jetbrains.annotations.NotNull ItemStack repairMaterial);
|
||||
|
||||
+ /**
|
||||
+ * Returns an immutable multimap of attributes for the material and slot.
|
||||
+ * {@link Material#isItem()} must be true for this material.
|
||||
+ *
|
||||
+ * @param material the material
|
||||
+ * @param equipmentSlot the slot to get the attributes for
|
||||
+ * @throws IllegalArgumentException if {@link Material#isItem()} is false
|
||||
+ * @return an immutable multimap of attributes
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.NotNull
|
||||
+ public Multimap<Attribute, AttributeModifier> getItemAttributes(@org.jetbrains.annotations.NotNull Material material, @org.jetbrains.annotations.NotNull EquipmentSlot equipmentSlot);
|
||||
+
|
||||
/**
|
||||
* Returns the server's protocol version.
|
||||
*
|
||||
|
Reference in New Issue
Block a user