mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-22 04:37:42 +01:00
Switch Arrow input class to AbstractArrow, which implements both the Arrow and Spectral Arrow classes, fixing potion effects not appearing onto SpectralArrows. Tipped arrows also work, prior to this update, and still work after, which will close any open issues related to tipped_arrows, as the particles and potion effects work for tipped_arrows.
This commit is contained in:
parent
441de831fc
commit
0bb04ba98a
@ -102,11 +102,11 @@ public class EntityManager implements Listener {
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void customBowDamage(EntityDamageByEntityEvent event) {
|
||||
if (!(event.getDamager() instanceof Projectile) || !(event.getEntity() instanceof LivingEntity) || event.getEntity().hasMetadata("NPC"))
|
||||
if (!(event.getDamager() instanceof Projectile) || !(event.getDamager() instanceof AbstractArrow) || !(event.getEntity() instanceof LivingEntity) || event.getEntity().hasMetadata("NPC"))
|
||||
return;
|
||||
|
||||
final Projectile projectile = (Projectile) event.getDamager();
|
||||
final ProjectileData data = getProjectileData(projectile);
|
||||
final ProjectileData data = projectiles.get(projectile.getEntityId());
|
||||
if (data == null)
|
||||
return;
|
||||
|
||||
@ -114,7 +114,7 @@ public class EntityManager implements Listener {
|
||||
double baseDamage = data.getDamage();
|
||||
|
||||
// Apply power vanilla enchant
|
||||
if (projectile instanceof Arrow && data.getSourceItem().getItem().hasItemMeta()
|
||||
if (projectile instanceof AbstractArrow && data.getSourceItem().getItem().hasItemMeta()
|
||||
&& data.getSourceItem().getItem().getItemMeta().getEnchants().containsKey(Enchantment.ARROW_DAMAGE))
|
||||
baseDamage *= 1.25 + (.25 * data.getSourceItem().getItem().getItemMeta().getEnchantLevel(Enchantment.ARROW_DAMAGE));
|
||||
|
||||
@ -127,7 +127,7 @@ public class EntityManager implements Listener {
|
||||
return;
|
||||
|
||||
final ProjectileAttackMetadata projAttack = (ProjectileAttackMetadata) event.getAttack();
|
||||
final ProjectileData data = getProjectileData(projAttack.getProjectile());
|
||||
final ProjectileData data = projectiles.get(projAttack.getProjectile().getEntityId());
|
||||
if (data == null)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user