mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-21 05:44:17 +00:00
Fix / Implement merge changes
This commit is contained in:
parent
fe6439528f
commit
d5bd36a2d4
3 changed files with 22 additions and 11 deletions
|
@ -2657,13 +2657,13 @@ public interface Material extends Keyed, Comparable<Material> {
|
|||
* @param slot the {@link EquipmentSlot} to check
|
||||
* @return the immutable {@link Multimap} with the respective default
|
||||
* Attributes and modifiers, or an empty map if no attributes are set.
|
||||
* @see Material#asItemType()
|
||||
* @see ItemType#getDefaultAttributeModifiers()
|
||||
* @deprecated Can only get default attribute modifiers from ItemType
|
||||
*/
|
||||
@NotNull
|
||||
public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(@NotNull EquipmentSlot slot) {
|
||||
Validate.isTrue(isItem(), "The Material is not an item!");
|
||||
|
||||
return Bukkit.getUnsafe().getDefaultAttributeModifiers(this, slot);
|
||||
}
|
||||
@Deprecated
|
||||
Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(@NotNull EquipmentSlot slot);
|
||||
|
||||
/**
|
||||
* @param other to compare to.
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
package org.bukkit;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import org.bukkit.advancement.Advancement;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.plugin.InvalidPluginException;
|
||||
|
@ -74,8 +70,6 @@ public interface UnsafeValues {
|
|||
*/
|
||||
boolean removeAdvancement(NamespacedKey key);
|
||||
|
||||
Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(Material material, EquipmentSlot slot);
|
||||
|
||||
Material getLegacyMaterial(String name);
|
||||
|
||||
@Deprecated
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package org.bukkit.inventory;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
@ -1173,4 +1176,18 @@ public interface ItemType extends Material {
|
|||
*/
|
||||
@NotNull
|
||||
EquipmentSlot getEquipmentSlot();
|
||||
|
||||
/**
|
||||
* Return an immutable copy of all default {@link Attribute}s and their
|
||||
* {@link AttributeModifier}s for a given {@link EquipmentSlot}.
|
||||
*
|
||||
* Default attributes are those that are always preset on some items, such
|
||||
* as the attack damage on weapons or the armor value on armor.
|
||||
*
|
||||
* @param slot the {@link EquipmentSlot} to check
|
||||
* @return the immutable {@link Multimap} with the respective default
|
||||
* Attributes and modifiers, or an empty map if no attributes are set.
|
||||
*/
|
||||
@NotNull
|
||||
Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(@NotNull EquipmentSlot slot);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue