mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-05 06:57:35 +01:00
Fixed MI bows dealing 3x damage in 1.21
This commit is contained in:
parent
bd75a6883a
commit
e97e7a6ccd
@ -20,6 +20,7 @@ import net.Indyuce.mmoitems.api.interaction.projectile.ArrowParticles;
|
|||||||
import net.Indyuce.mmoitems.api.interaction.weapon.Weapon;
|
import net.Indyuce.mmoitems.api.interaction.weapon.Weapon;
|
||||||
import net.Indyuce.mmoitems.api.player.PlayerData;
|
import net.Indyuce.mmoitems.api.player.PlayerData;
|
||||||
import net.Indyuce.mmoitems.api.util.message.Message;
|
import net.Indyuce.mmoitems.api.util.message.Message;
|
||||||
|
import net.Indyuce.mmoitems.util.MMOUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
@ -247,7 +248,7 @@ public class ItemUse implements Listener {
|
|||||||
final ProjectileMetadata proj = ProjectileMetadata.create(playerData.getMMOPlayerData(), bowSlot, ProjectileType.ARROW, event.getProjectile());
|
final ProjectileMetadata proj = ProjectileMetadata.create(playerData.getMMOPlayerData(), bowSlot, ProjectileType.ARROW, event.getProjectile());
|
||||||
proj.setSourceItem(item);
|
proj.setSourceItem(item);
|
||||||
proj.setCustomDamage(true);
|
proj.setCustomDamage(true);
|
||||||
proj.setDamageMultiplier(event.getForce());
|
proj.setDamageMultiplier(MMOUtils.getForce(event));
|
||||||
if (item.hasTag("MMOITEMS_ARROW_PARTICLES"))
|
if (item.hasTag("MMOITEMS_ARROW_PARTICLES"))
|
||||||
new ArrowParticles((AbstractArrow) event.getProjectile(), item);
|
new ArrowParticles((AbstractArrow) event.getProjectile(), item);
|
||||||
final AbstractArrow arrow = (AbstractArrow) event.getProjectile();
|
final AbstractArrow arrow = (AbstractArrow) event.getProjectile();
|
||||||
|
@ -7,6 +7,7 @@ import io.lumine.mythic.lib.api.item.ItemTag;
|
|||||||
import io.lumine.mythic.lib.api.item.NBTItem;
|
import io.lumine.mythic.lib.api.item.NBTItem;
|
||||||
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
|
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
|
||||||
import io.lumine.mythic.lib.skill.trigger.TriggerType;
|
import io.lumine.mythic.lib.skill.trigger.TriggerType;
|
||||||
|
import io.lumine.mythic.lib.util.annotation.BackwardsCompatibility;
|
||||||
import io.lumine.mythic.lib.version.VPotionEffectType;
|
import io.lumine.mythic.lib.version.VPotionEffectType;
|
||||||
import net.Indyuce.mmoitems.MMOItems;
|
import net.Indyuce.mmoitems.MMOItems;
|
||||||
import net.Indyuce.mmoitems.api.Type;
|
import net.Indyuce.mmoitems.api.Type;
|
||||||
@ -18,6 +19,7 @@ import org.bukkit.entity.LivingEntity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
|
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
@ -36,6 +38,12 @@ public class MMOUtils {
|
|||||||
return particle.getDataType() == Particle.DustOptions.class;
|
return particle.getDataType() == Particle.DustOptions.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BackwardsCompatibility(version = "1.21")
|
||||||
|
public static double getForce(@NotNull EntityShootBowEvent event) {
|
||||||
|
final double force = event.getForce();
|
||||||
|
return MythicLib.plugin.getVersion().isUnder(1, 21) ? force : force / 3;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optimized Soulbound check based on the fact that the
|
* Optimized Soulbound check based on the fact that the
|
||||||
* compressed item Soulbound data contains only one UUID,
|
* compressed item Soulbound data contains only one UUID,
|
||||||
|
Loading…
Reference in New Issue
Block a user