fix PotionEffectType#getEffectAttributes

This commit is contained in:
Lulu13022002 2024-04-27 21:48:14 +02:00
parent a0c2ebbdd4
commit 9c0da4515d

View File

@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ final java.util.Map<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> attributeMap = new java.util.HashMap<>(); + final java.util.Map<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> attributeMap = new java.util.HashMap<>();
+ this.handle.attributeModifiers.forEach((attribute, attributeModifier) -> { + this.handle.attributeModifiers.forEach((attribute, attributeModifier) -> {
+ attributeMap.put( + attributeMap.put(
+ org.bukkit.craftbukkit.attribute.CraftAttribute.stringToBukkit(attribute.toString()), + org.bukkit.craftbukkit.attribute.CraftAttribute.minecraftHolderToBukkit(attribute),
+ // use zero as amplifier to get the base amount, as it is amount = base * (amplifier + 1) + // use zero as amplifier to get the base amount, as it is amount = base * (amplifier + 1)
+ org.bukkit.craftbukkit.attribute.CraftAttributeInstance.convert(attributeModifier.create(this.handle.getDescriptionId(), 0)) + org.bukkit.craftbukkit.attribute.CraftAttributeInstance.convert(attributeModifier.create(this.handle.getDescriptionId(), 0))
+ ); + );