mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-03 06:37:47 +01:00
Fixed staffs and whips dealing no damage
This commit is contained in:
parent
f5e55c01a4
commit
af8c81e8a9
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>net.Indyuce</groupId>
|
||||
<artifactId>MMOItems</artifactId>
|
||||
<version>6.6.1</version>
|
||||
<version>6.6.2</version>
|
||||
<name>MMOItems</name>
|
||||
<description>A great item solution for your RPG server!!</description>
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class ItemAttackMetadata extends AttackMetadata {
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies all necessary on-hit effects for any type of damage.
|
||||
* Applies all necessary weapon on-hit effects for any type of damage.
|
||||
* Makes things much easier for untargeted weapons like staffs
|
||||
*
|
||||
* @param item The item being used
|
||||
|
@ -49,7 +49,7 @@ public class Whip extends UntargetedWeapon {
|
||||
MMORayTraceResult trace = MythicLib.plugin.getVersion().getWrapper().rayTrace(stats.getPlayer(), range,
|
||||
entity -> MMOUtils.canTarget(stats.getPlayer(), entity, InteractionType.OFFENSE_ACTION));
|
||||
if (trace.hasHit())
|
||||
new ItemAttackMetadata(new DamageMetadata(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.PHYSICAL), stats).applyEffects(getNBTItem(), trace.getHit());
|
||||
new ItemAttackMetadata(new DamageMetadata(attackDamage, DamageType.WEAPON, DamageType.PROJECTILE, DamageType.PHYSICAL), stats).applyEffectsAndDamage(getNBTItem(), trace.getHit());
|
||||
trace.draw(loc, getPlayer().getEyeLocation().getDirection(), 2,
|
||||
(tick) -> tick.getWorld().spawnParticle(Particle.CRIT, tick, 0, .1, .1, .1, 0));
|
||||
getPlayer().getWorld().playSound(getPlayer().getLocation(), VersionSound.ENTITY_FIREWORK_ROCKET_BLAST.toSound(), 1, 2);
|
||||
|
@ -20,7 +20,7 @@ public class LightningSpirit implements StaffAttackHandler {
|
||||
MMORayTraceResult trace = MythicLib.plugin.getVersion().getWrapper().rayTrace(attackMeta.getDamager(), range,
|
||||
entity -> MMOUtils.canTarget(attackMeta.getDamager(), entity, InteractionType.OFFENSE_ACTION));
|
||||
if (trace.hasHit())
|
||||
attackMeta.applyEffects(nbt, trace.getHit());
|
||||
attackMeta.applyEffectsAndDamage(nbt, trace.getHit());
|
||||
trace.draw(loc, attackMeta.getDamager().getEyeLocation().getDirection(), 2,
|
||||
loc1 -> loc1.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, loc1, 0));
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class ManaSpirit implements StaffAttackHandler {
|
||||
}
|
||||
for (Entity target : targets)
|
||||
if (MMOUtils.canTarget(attackMeta.getDamager(), loc, target, InteractionType.OFFENSE_ACTION)) {
|
||||
attackMeta.applyEffects(nbt, (LivingEntity) target);
|
||||
attackMeta.applyEffectsAndDamage(nbt, (LivingEntity) target);
|
||||
loc.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, loc, 0);
|
||||
cancel();
|
||||
return;
|
||||
|
@ -39,7 +39,7 @@ public class NetherSpirit implements StaffAttackHandler {
|
||||
loc.getWorld().spawnParticle(Particle.SMOKE_NORMAL, loc, 0);
|
||||
for (Entity target : targets)
|
||||
if (MMOUtils.canTarget(attackMeta.getDamager(), loc, target, InteractionType.OFFENSE_ACTION)) {
|
||||
attackMeta.applyEffects(nbt, (LivingEntity) target);
|
||||
attackMeta.applyEffectsAndDamage(nbt, (LivingEntity) target);
|
||||
loc.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, loc, 0);
|
||||
cancel();
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user